
program Pr1810;

{$APPTYPE CONSOLE}

type
  pelement=^element;
  element=record
    value: integer;
    next: pelement;
  end;
var
  head, h, l: pelement;
  n, i: integer;
  fin: textFile;

procedure Del (var f: pelement);
var
  tmp, ff: pelement;
begin
  while ((f<>nil) and ((f^.value mod 2)=0)) do
  begin
    tmp:=f^.next;
    dispose(f);
    f:=tmp;
  end;
  ff:=f;
  while (ff^.next<>nil) do
  begin
    if ((ff.value mod 2)=0) then
    begin
      tmp^.next:=ff^.next;
      dispose(ff);
      ff:=tmp^.next;
    end
  else
  begin
    tmp:=ff;
    ff:=ff^.next;
  end;
  end;
  if ((ff^.value mod 2)=0) then
  begin
    dispose(ff);
    tmp^.next:=nil;
  end;
end;

procedure Sum (var f: pelement);
var
  ff: pelement;
  i: integer;
begin
  ff:=f;
  i:=1;
  while (ff<>nil)  do
  begin
    ff^.value:=ff^.value+i;
    i:=i+1;
    ff:=ff^.next;
  end;
end;

begin
  assign(fin, 'input1810.txt');
  reset(fin);
  read(fin, n);
  new(head);
  h:=head;
  l:=head;
  read(fin, h^.value);
  for i:=0 to n-2 do
  begin
    new(head^.next);
    head:=head^.next;
    read(fin, head^.value);
  end;
  head^.next:=nil;
  Del(h);
  l:=h;
  while (h<> nil) do
  begin
    writeln(h^.value);
    h:=h^.next;
  end;
  writeln;
  Sum(l);
  while (l<> nil) do
  begin
    writeln(l^.value);
    l:=l^.next;
  end;
  readln;
end.
